        <include file="Public:top_frame" />
        <!-- /section:basics/navbar.layout -->
        <div class="main-container" id="main-container">
            <script type="text/javascript">
                try{ace.settings.check('main-container' , 'fixed')}catch(e){}
            </script>
            <include file="Public:left_frame" />
            <!-- /section:basics/sidebar -->
            <div class="main-content">
                <div class="main-content-inner">
                    <!-- #section:basics/content.breadcrumbs -->
                    <div class="breadcrumbs" id="breadcrumbs">
                        <script type="text/javascript">
                            try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
                        </script>
                        <ul class="breadcrumb">
                            <li>
                                <i class="ace-icon fa fa-home home-icon"></i>
                                <a href="{:U('/index/index')}">首页</a>
                            </li>
                            <li>
                                <a href="{:U('/match/index')}">大赛管理</a>
                            </li>
                            <li>
                                比赛结果一览
                            </li>
                        </ul><!-- /.breadcrumb -->
                        <!-- /section:basics/content.searchbox -->
                    </div>

                    <!-- /section:basics/content.breadcrumbs -->
                    <div class="page-content">
                        <div class="page-header">
                            <h1>{$info.name}</h1>
                            <input type="hidden" id="match_id" name="match_id" value="{$info.id}" />
                        </div><!-- /.page-header -->
                        <div class="row">
                            <div class="col-xs-12">
                                <!-- PAGE CONTENT BEGINS -->
                                <div class="row">
                                    <div class="col-xs-12">
                                        <!-- <div class="table-header">
                                            Results for "Latest Registered Domains"
                                        </div> -->
                                        <div style="text-align:right;">
                                			<button class="btn btn-primary" onclick="result_input('{$info.id}')">录入结果</button>
                            			</div>
                                        <div class="space-4"></div>
                                        <div>
                                            <table id="sample-table-2" class="table table-striped table-bordered table-hover">
                                                <thead>
                                                    <tr>
                                                        <th class="center">名次</th>
                                                        <th>昵称(姓名)</th>
                                                        <th>选手类型</th>
                                                        <th>是否与种子选手对战</th>
                                                        <th>种子选手姓名</th>
                                                        <th>操作</th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                    <volist name="list" id="ls" key="k">
                                                        <tr>
                                                            <td class="center">{$ls.rank}</td>
                                                            <td>{$ls.name}</td>
                                                            <td>{$ls.type|showMemberType}</td>
                                                            <td>{$ls.vs_type|showYesOrNo}</td>
                                                            <td>{$ls.vs_seed_name|default='-'}</td>
                                                            <td>
                                                                <a class="red" href="javascript:void(0);" onclick="del_data('{$ls.id}')">删除</a>
                                                            </td>
                                                        </tr>
                                                    </volist>
                                                </tbody>
                                            </table>
                                        </div>
                                        <div class="space-4"></div>
                                        <!--<div>-->
                                        	<!--<button class="btn btn-white btn-info btn-bold" onclick="javascript:window.open('__URL__/downloadAsCsv')">-->
												<!--<i class="ace-icon fa fa-floppy-o bigger-120 blue"></i>-->
												<!--Export CSV-->
											<!--</button>-->
										<!--</div>-->
                                    </div>
                                </div>
                            </div><!-- /.col -->
                        </div><!-- /.row -->
                    </div><!-- /.page-content -->
                </div>
            </div><!-- /.main-content -->
            <include file="Public:footer" />
        </div><!-- /.main-container -->
        <!-- basic scripts -->
        <div id="dialog-confirm" class="hide">
            <div class="alert bigger-110 del_info">
                <!-- These items will be permanently deleted and cannot be recovered. -->
            </div>
        </div><!-- #dialog-confirm -->
		<div id="dialog-confirm-1" class="hide">
            <div class="alert bigger-110 operation">
                <!-- These items will be permanently deleted and cannot be recovered. -->
            </div>
        </div><!-- #dialog-confirm -->
        <!--[if !IE]> -->
        <script type="text/javascript">
            window.jQuery || document.write("<script src='__PUBLIC__/admin/assets/js/jquery.js'>"+"<"+"/script>");
        </script>
        <!-- <![endif]-->

        <!--[if IE]>
        <script type="text/javascript">
            window.jQuery || document.write("<script src='__PUBLIC__/admin/assets/js/jquery1x.js'>"+"<"+"/script>");
        </script>
        <![endif]-->
        <script type="text/javascript">
            if('ontouchstart' in document.documentElement) document.write("<script src='__PUBLIC__/admin/assets/js/jquery.mobile.custom.js'>"+"<"+"/script>");
        </script>
        <script src="__PUBLIC__/admin/assets/js/bootstrap.js"></script>

        <!-- page specific plugin scripts -->
        <script src="__PUBLIC__/admin/assets/js/jquery-ui.js"></script>
        <script src="__PUBLIC__/admin/assets/js/jquery.ui.touch-punch.js"></script>

        <!-- page specific plugin scripts -->
        <script src="__PUBLIC__/admin/assets/js/jquery.dataTables.js"></script>
        <script src="__PUBLIC__/admin/assets/js/jquery.dataTables.bootstrap.js"></script>

        <!-- ace scripts -->
        <script src="__PUBLIC__/admin/assets/js/ace/elements.scroller.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/elements.colorpicker.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/elements.fileinput.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/elements.typeahead.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/elements.wysiwyg.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/elements.spinner.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/elements.treeview.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/elements.wizard.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/elements.aside.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/ace.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/ace.ajax-content.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/ace.touch-drag.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/ace.sidebar.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/ace.sidebar-scroll-1.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/ace.submenu-hover.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/ace.widget-box.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/ace.settings.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/ace.settings-rtl.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/ace.settings-skin.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/ace.widget-on-reload.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/ace.searchbox-autocomplete.js"></script>

        <!-- inline scripts related to this page -->
        <script type="text/javascript">
            jQuery(function($) {
                $('.nav-list li').removeClass('open').removeClass('active');
                $('#left_2').addClass('open').addClass('active');
                $('#left_2_1').addClass('active');

                $('#sample-table-2').dataTable({
                    bAutoWidth: false,
                    "aoColumns": [
                        null,
                        {"bSortable": false, "sWidth": "20%"},
                        {"bSortable": false, "sWidth": "10%"},
                        {"bSortable": false, "sWidth": "10%"},
                        {"bSortable": false, "sWidth": "20%"},
                        {"bSortable": false, "sWidth": "30%"}
                    ],
                    "aaSorting": [],
                    "oLanguage": {
                        "sLengthMenu": "每页 _MENU_ 条记录",
                        "sZeroRecords": "对不起，查询不到相关数据！",
                        "sInfo": "当前显示 _START_ 到 _END_ 条，共 _TOTAL_ 条记录",
                        "sSearch": "搜索: ",
                        "oPaginate": {
                            "sFirst": "首页",
                            "sPrevious": "上一页",
                            "sNext": "下一页",
                            "sLast": "尾页"
                        }
                    }
                });

                $(document).on('click', 'th input:checkbox' , function(){
                    var that = this;
                    $(this).closest('table').find('tr > td:first-child input:checkbox')
                    .each(function(){
                        this.checked = that.checked;
                        $(this).closest('tr').toggleClass('selected');
                    });
                });
            
                $('[data-rel="tooltip"]').tooltip({placement: tooltip_placement});

                function tooltip_placement(context, source) {
                    var $source = $(source);
                    var $parent = $source.closest('table')
                    var off1 = $parent.offset();
                    var w1 = $parent.width();
            
                    var off2 = $source.offset();
                    //var w2 = $source.width();
            
                    if( parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2) ) return 'right';
                    return 'left';
                }
            });

			//override dialog's title function to allow for HTML titles
			$.widget("ui.dialog", $.extend({}, $.ui.dialog.prototype, {
				_title: function(title) {
					var $title = this.options.title || '&nbsp;'
					if( ("title_html" in this.options) && this.options.title_html == true )
						title.html($title);
					else title.text($title);
				}
			}));

            function result_input(match_id) {
                location.href= "__URL__/resultInput/match_id/" + match_id;
            }

			function del_data(id) {
				$(".del_info").html('确定删除');
                $( "#dialog-confirm" ).removeClass('hide').dialog({
                    resizable: false,
                    modal: true,
                    title: "<div class='widget-header'><h4 class='smaller'><i class='ace-icon fa fa-exclamation-triangle red'></i> 删除数据</h4></div>",
                    title_html: true,
                    buttons: [
                        {
                            html: "<i class='ace-icon fa fa-trash-o bigger-110'></i>&nbsp; 删除",
                            "class" : "btn btn-danger btn-xs",
                            click: function() {
                                var mid = $('#match_id').val();
                                // alert(id);
				                $.ajax({
				                    type: "POST",
				                    dataType: "json",
				                    data: {
				                        id: id,
                                        table: 'match_result'
				                    },
				                    async: true,
				                    url: "__URL__/delData",
				                    success : function(res) {
				                        if (res) {
				                            if (res.code == 100) {
                                                alert("删除成功");
				                                window.location.href = "__URL__/result/match_id/" + mid;
				                            } else {
				                                alert(res.message);
				                                return;
				                            }
				                        } else {
				                            alert("删除失败");
				                        }
				                    },
				                    error: function(XMLHttpRequest, textStatus, errorThrown) {
//				                        alert("网络异常,错误代码: " + XMLHttpRequest.status);
                                        alert("网络异常");
				                    }
				                });
                            }
                        },
                        {
                            html: "<i class='ace-icon fa fa-times bigger-110'></i>&nbsp; 取消",
                            "class" : "btn btn-xs",
                            click: function() {
                                $(this).dialog("close");
                            }
                        }
                    ]
                });
			}

            function change_status(id, status, username) {
            	var txt = "";
            	if (status == 1) {
					txt = '冻结';
					$(".operation").html('确定冻结【' + username + '】?');
            	} else {
            		txt = '启用';
            		$(".operation").html('确定启用【' + username + '】?');
            	}

            	$("#dialog-confirm-1").removeClass('hide').dialog({
                    resizable: false,
                    modal: true,
                    title: "<div class='widget-header'><h4 class='smaller'> "+ txt +"用户</h4></div>",
                    title_html: true,
                    buttons: [
                        {
                            html: txt,
                            "class" : "btn btn-primary btn-xs",
                            click: function() {
				                $.ajax({
				                    type: "POST",
				                    dataType: "json",
				                    data: {
				                        id: id,
				                        status: status,
                                        model: 'user'
				                    },
				                    async: true,
				                    url: "__URL__/changeRoleStatus",
				                    success : function(res) {
				                        if (res) {
				                            if (res.status) {
                                                alert(res.message);
				                                window.location.href = '__URL__/index';
				                            } else {
				                                alert(res.message);
                                                window.location.href = '__URL__/index';
				                            }
				                        } else {
				                            alert(txt + "失败");
				                        }
				                    },
				                    error: function(XMLHttpRequest, textStatus, errorThrown) {
                                        alert("网络异常");
				                    }
				                });
                            }
                        },
                        {
                            html: "取消",
                            "class" : "btn btn-xs",
                            click: function() {
                                $(this).dialog("close");
                            }
                        }
                    ]
                });
            }
        </script>
    </body>
</html>